package com.kirk.cts.ui.view.bar;


import com.kirk.cts.core.loader.LanguageLoader;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Component;

import javax.swing.*;
import java.util.List;

/**
 * <p> AppToolBar.java </p>
 *
 * @version 1.0.0
 * @Author kirkliu
 * @Date 2020-09-01 22:59
 * @Description 工具栏
 */
@Component("appToolBar")
public class AppToolBar extends JToolBar {
    private static final long serialVersionUID = 1L;


    public AppToolBar() {
        super(LanguageLoader.getString("CrawlerMainFrame.Tool"));
    }


    /**
     * 加载插件工具栏
     */
    public void loadPluginToolBar(List<Action> toolBarList) {
        if (CollectionUtils.isNotEmpty(toolBarList)) {
            for (Action action : toolBarList) {
                this.add(action);
            }
            addSeparator();
        }
    }

}
